import React, { Component } from 'react'
import { Link, Route } from 'react-router-dom'
import details from '../details/details.jsx'

export default class params extends Component {
  state = {
    adminList: [
      { id: 1, name: '橘子一号' },
      { id: 2, name: '橘子二号' },
      { id: 3, name: '橘子三号' },
      { id: 4, name: '橘子四号' },
      { id: 5, name: '橘子五号' },
      { id: 6, name: '橘子六号' },
      { id: 7, name: '橘子七号' },
      { id: 8, name: '橘子八号' }
    ]
  }
  render() {
    return (
      <div>
        <ul>
          {this.state.adminList.map(v => (
            <li key={v.id}><Link to={{pathname: `${this.props.match.path}/details`, state: {...v}}}>{v.name}</Link></li>
          ))}
        </ul>
        <hr />
        <Route path="/parameter/state/details" component={details} />
      </div>
    )
  }
}
